function MI_dist_ForOneCell(Placeness_MetaData,recording,cellname)

% this function plots MI value of a single cell upon its shuffled
% distribution for you to visualize its MI shuffle test result

Placeness = Placeness_MetaData(recording).Place_Cell_Summary;
Placeness_cell = Placeness(cellname,1);

if Placeness_cell == 1
    disp('cell is a place cell')
elseif Placeness_cell == 0
    disp('cell is not a place cell')
else
    disp('no such cell')
end

MI = Placeness_MetaData(recording).MI_values;
MI_cell = MI(cellname,1);

MI_Shuffle = Placeness_MetaData(recording).MI_Shuffled_values;
MI_cell_shuffle = MI_Shuffle(cellname,1,:);
MI_cell_shuffle = MI_cell_shuffle(:);


scatter(MI_cell, 10, 500, 'filled', 'r')
hold on
histogram(MI_cell_shuffle,40,'BinLimits',[0 0.02],'FaceColor','b','FaceAlpha',0.3)
ylim([0 0.15*size(MI_cell_shuffle,1)])
xlabel('MI value')
ylabel('# of Shuffle')
set(gca,'FontSize',10);
hold off

end